package homework04;

import homework04.HeapManager;

public class Driver {

	
	public static void main(String args[]){
		int[] arr = new int[20];
	
		HeapManager h = new HeapManager(arr);
	
		int p1 = h.allocate(3);	
		int p2 = h.allocate(5);
        int p3 = h.allocate(6);
		int p4 = h.allocate(2);
		//int p6 = h.allocate(1);
       
	    h.deallocate(p4);
	     h.deallocate(p2);
	     h.deallocate(p3);
		h.deallocate(p1);
	     
	   int p5 = h.allocate(3);
	   
		
		
		for(int i = 0; i < arr.length; i++){
			System.out.println(i + ":" + arr[i]);
		}
		
		System.out.println( "\n" + h.getFreeStart());
		
		
	}//end main
	
	
	
}
